﻿namespace ChessToys.ChessController
{
    using System;
    using System.Collections.Generic;
    using ChessToys;

    public class RandomChessController : AbstractChessController
    {
        private static Random RANDOM = new Random();

        /// <inheritdoc />
        public override Move NextMove(Board board)
        {
            IList<Move> moves = new List<Move>(MoveGeneratorUtils.PossibleMoves(board, board.ColorToMove));
            return moves[RANDOM.Next(moves.Count - 1)];
        }
    }
}
